package com.ssy.lingxi.marketing.api.fallback;

import com.ssy.lingxi.common.response.ResponseCode;
import com.ssy.lingxi.common.response.Wrapper;
import com.ssy.lingxi.marketing.api.feign.CouponControllerFeign;
import com.ssy.lingxi.marketing.api.model.request.CartOrderReq;
import com.ssy.lingxi.marketing.api.model.request.CouponConsumeReq;
import com.ssy.lingxi.marketing.api.model.request.CouponDetailConsumeReq;
import com.ssy.lingxi.marketing.api.model.request.CouponQueryReq;
import com.ssy.lingxi.marketing.api.model.response.CartOrderResp;
import com.ssy.lingxi.marketing.api.model.response.CouponInfoResp;
import org.springframework.stereotype.Component;

import javax.validation.Valid;
import java.util.List;

/** 优惠券feign接口降级实现
 * @author yzc
 * @version 2.0.0
 * @date 2021/11/3
 */
@Component
public class CouponFeignControllerFallback implements CouponControllerFeign {

    @Override
    public Wrapper<List<CartOrderResp>> checkCouponAvailable(@Valid CartOrderReq req) {
        return Wrapper.fail(ResponseCode.MARKETING_SERVICE_ERROR);
    }

    @Override
    public Wrapper<Void> consumeCoupon(CouponConsumeReq req) {
        return Wrapper.fail(ResponseCode.MARKETING_SERVICE_ERROR);
    }

    @Override
    public Wrapper<Void> returnCoupon(List<CouponDetailConsumeReq> req) {
        return Wrapper.fail(ResponseCode.MARKETING_SERVICE_ERROR);
    }

    @Override
    public Wrapper<List<CouponInfoResp>> getCouponDetailListByIds(CouponQueryReq req) {
        return Wrapper.fail(ResponseCode.MARKETING_SERVICE_ERROR);
    }
}
